package com.shoulder.boot.demo.controller;

import com.shoulder.boot.demo.service.Demo2Service;
import com.shoulder.boot.demo.vo.DemoVo;
import com.shoulder.core.annotation.Anonymous;
import com.shoulder.core.api.ApiResult;
import com.shoulder.log.annotation.LogAnnotation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 样例信息管理
 */
@RestController
@AllArgsConstructor
@RequestMapping("/admin/api/v1/demo/demo2")
public class Demo2Controller {

    private final Demo2Service demo2Service;

    @Anonymous
    @LogAnnotation(type = "样例信息列表权限测试", record = false)
    @GetMapping("/test")
    public ApiResult<List<DemoVo>> test() {
        List<DemoVo> list = this.demo2Service.demoTest();
        return ApiResult.ok(list);
    }
    @LogAnnotation(type = "样例信息列表权限测试", record = false)
    @GetMapping("/test2")
    public ApiResult<List<DemoVo>> test2() {
        List<DemoVo> list = this.demo2Service.demoTest2();
        return ApiResult.ok(list);
    }
}